fldmeta_prop.func.MessageFlow = {};

//on style change
fldmeta_prop.func.MessageFlow.onDisplayStyle = function(elemid, rId, nv) {
	if(rId=="displayStyle_fontColor"){
		var text = Snap("g[data-element-id='"+elemid+"_label'] g.djs-visual text");
		text && text.attr({"fill" : nv || flstyle.elem.defaultFontColor});
	}
};

//on component removed //如果为路径，删除路径对应的路由设置
fldmeta_prop.funcOnCompRemoved.MessageFlow = function(elemid, elem) {
	for (var compid in fl.curflow.bpmnConfig) {
		if (fl.curflow.bpmnConfig[compid].route) {
			if (fl.curflow.bpmnConfig[compid].route.defaultTransition==elemid) {
				delete fl.curflow.bpmnConfig[compid].route.defaultTransition;
			} else {
				delete fl.curflow.bpmnConfig[compid].route.transitionConditions[elemid];
			}
		}
	}
};


//properties settings for MessageFlow
fldmeta_prop.control.MessageFlow = {
		"includes-properties" : {
			"common" : fldmeta_prop.common.all.properties,
			"connectioncommon" : fldmeta_prop.common.connection.properties
		},
		"properties" : {
			//"route" : fldmeta_prop.common.predefined["route"]
		},
		"styles" : {
			"displayStyle" : {
				"name" : fmd_i18n_prop_tip_customstyle,
				"img" : "css.png",
		    	"cellType" : {
		    		"type" : "coro",
		    		"options" : fmd_i18n_prop_displayStyle_vals
		    	},
		    	"value" : {"default":"theme"},
		    	"conditional-sub" : {
		    		"custom" : {
		    			/*"displayStyle_connPathColor" : function() {
		    				var obj1 = MyUtilJs.copyObj(fldmeta_prop.common.predefined["displayStyle_connPathColor"]);
		    				obj1.value["default"] = flstyle.elem.attrs.flow.stroke;
		    				return obj1;
		    			},*/
		    			"displayStyle_fontColor" : function() {
		    				var obj1 = MyUtilJs.copyObj(fldmeta_prop.common.predefined["displayStyle_fontColor"]);
		    				obj1.value["default"] = flstyle.elem.defaultFontColor;
		    				return obj1;
		    			}
		    		}
		    	}
			}
		},
		"onApply" : function() {
		},
		"propDhxGridEvents" : {
			"onCellChanged" : function(rId,cId,nv) {
				fldmeta_prop.func.onCellChanged_common(rId,cId,nv,
						JSONSelect.match("."+rId, fldmeta_prop.control.MessageFlow));
				fldmeta_prop.func.onCellChanged_stylecommon(rId,cId,nv);
			}
		}
	};


